package com.liaoye.hellocustomview.view;

import android.graphics.Canvas;
import android.graphics.Paint;
import android.text.ParcelableSpan;
import android.text.TextPaint;
import android.text.style.CharacterStyle;
import android.text.style.ParagraphStyle;
import android.text.style.ReplacementSpan;
import android.text.style.UpdateAppearance;
import android.text.style.UpdateLayout;

import androidx.annotation.NonNull;
import androidx.annotation.Nullable;

public abstract class ForegroundColorSpan extends CharacterStyle implements UpdateLayout {
    private int mColor;

    ForegroundColorSpan(int color) {
        mColor = color;
    }

    public int getForegroundColor() {
        return mColor;
    }


    @Override
    public void updateDrawState(TextPaint ds) {
        ds.setColor(mColor);
    }
}
